package com.hexus.eve.utils;

import org.springframework.security.core.context.SecurityContextHolder;

import com.hexus.eve.entities.security.User;

public class CurrentUser {
	public static User getUser() {
		return (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	}
	
	public static String getUsername() {
		User user = getUser();
		return user.getName();
	}
}
